package pl.myapp.webtest.config.security;

import org.jboss.seam.security.Identity;
import org.jboss.seam.security.annotations.Secures;
import pl.myapp.webtest.config.security.qualifier.Admin;

/**
* @author <a href="mailto:bleathem@gmail.com">Brian Leathem</a>
*/
public class SecurityRules {
    public
    @Secures
    @Admin
    boolean adminChecker(Identity identity) {
        System.out.println("--------------- admiChecker !!!!!!!!!!");
        if (identity.getUser() == null) {

            return false;
        } else {
            System.out.println(identity.getUser().toString());
            return "admin".equals(identity.getUser().getId());
        }
    }
}